package org.softee.functional;

import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;

import org.softee.functional.exception.NotImplementedException;
import org.softee.functional.functions.BinaryOperator;
import org.softee.functional.functions.Block;
import org.softee.functional.functions.Mapper;
import org.softee.functional.functions.Predicate;

public class AtomizedParallelFunctionalIterable<T> extends AbstractFunctionalIterable<T> implements ParallelFunctionalIterable<T> {

    protected AtomizedParallelFunctionalIterable(Iterable<T> iterable) {
        super(iterable);
    }

    public static <T> ParallelFunctionalIterable<T> from(Iterable<T> iterable) {
        return new AtomizedParallelFunctionalIterable<T>(iterable);
    }

    public static <T> ParallelFunctionalIterable<T> from(T... elements) {
        return new AtomizedParallelFunctionalIterable<T>(Arrays.asList(elements));
    }

    @Override
    public LazyFunctionalIterable<T> sequential() {
        return SequentialFunctionalIterable.from(iterable);
    }

    @Override
    public boolean allMatch(Predicate<? super T> filter) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public boolean anyMatch(Predicate<? super T> filter) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public boolean noneMatch(Predicate<? super T> filter) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public ParallelFunctionalIterable<T> filter(Predicate<? super T> predicate) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public ParallelFunctionalIterable<T> uniqueElements() {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public ParallelFunctionalIterable<T> removeDuplicates() {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public ParallelFunctionalIterable<T> sorted() {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public ParallelFunctionalIterable<T> sorted(Comparator<? super T> comparator) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public <U extends Comparable<? super U>> ParallelFunctionalIterable<T> sortedBy(Mapper<? super T, U> extractor) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public ParallelFunctionalIterable<T> forEach(Block<? super T> operation) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public <U> ParallelFunctionalIterable<U> map(Mapper<? super T, ? extends U> mapper) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public <U> ParallelFunctionalIterable<U> flatMap(Mapper<? super T, ? extends Iterable<U>> mapper) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public <U> Map<T, U> mapped(Mapper<? super T, ? extends U> mapper) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public <U> Map<U, Collection<T>> groupBy(Mapper<? super T, ? extends U> mapper) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public T reduce(T base, BinaryOperator<T> binaryOperator) {
        // TODO Auto-generated method stub
        throw new NotImplementedException();
    }

    @Override
    public <U> U mapReduce(Mapper<? super T, ? extends U> mapper, U base, BinaryOperator<U> reducer) {
        return map(mapper).reduce(base, reducer);
    }
}
